{extends file="../global.html"}
{block name=body}

<style type="text/css">
    .container-fluid{ padding-right: 0;padding-left: 0; }
    /*.nav > li > a{ padding: 10px 229px; }*/
</style> 
{pr($result)}
<div class="container-fluid">
<div class="row">
 <div class="col-md-12 col-sm-12 col-lg-12 col-xs-12">
     <div class="panel panel-default">
         <div class="panel-heading">
             模块中心
             <a href="{url('run/Menus/add')}" class="btn btn-info" title=" ">添加一级栏目<i class="glyphicon glyphicon-plus"></i></a>
         </div>
         <div class="panel-body">
             <ul class="nav nav-tabs">
                 <li class="active"><a href="#settings" data-toggle="tab"><i class="fa fa-dashboard " style="font-size: 16px;"></i>RUN_后台</a>
                 </li>
                  <li class=""><a href="#home" data-toggle="tab">
                 <i class="glyphicon glyphicon-home"></i>HOME_前台</a>
                 </li>
             </ul>

             <div class="tab-content">
                 <div class="tab-pane fade " id="home">
                     <h4>Home Tab</h4>
                     <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                 </div>
                  
                
                 <div class="tab-pane fade active in" id="settings">
                     <div id="treeview6" class=""></div>
                 </div>
             </div>
         </div>
     </div>
 </div>
 </div>
<div>
 
<script type="text/javascript">

            $(function() { 

        var defaultData = [
         {foreach $result as $value}
          { 
           {if $value.status==1}
            text: '{$value.catname}',
           {/if}
            href: '#parent1',
            collapseIcon: "glyphicon glyphicon-unchecked",
            tags: ['5'],
/*            nodes: [
              { 
                text: 'Child 1',
                href: '#child1',
                tags: ['2'],
                nodes: [
                  { 
                    text: 'Grandchild 1',
                    href: '#grandchild1',
                    tags: ['0']
                  },
                  { 
                    text: 'Grandchild 2',
                    href: '#grandchild2',
                    tags: ['0']
                  }
                ]
              },
              { 
                text: 'Child 2',
                href: '#child2',
                tags: ['0']
              }
            ]*/
          },
           {/foreach}
         /* { 
            text: 'Parent 2',
            href: '#parent2',
            tags: ['0']
          },
          { 
            text: 'Parent 3',
            href: '#parent3',
             tags: ['0']
          },
          { 
            text: 'Parent 4',
            href: '#parent4',
            tags: ['0']
          },
          { 
            text: 'Parent 5',
            href: '#parent5'  ,
            tags: ['0']
          }*/
        ];

 

        var json = '[' +

          '{ ' +
            '"text": "Parent 1",' +
            '"nodes": [' +
              '{ ' +
                '"text": "Child 1",' +
                '"nodes": [' +
                  '{ ' +
                    '"text": "Grandchild 1"' +
                  '},' +
                  '{ ' +
                    '"text": "Grandchild 2"' +
                  '}' +
                ']' +
              '},' +
              '{ ' +
                '"text": "Child 2"' +
              '}' +
            ']' +
          '},' +
          '{ ' +
            '"text": "Parent 2"' +
          '},' +
          '{ ' +
            '"text": "Parent 3"' +
          '},' +
          '{ ' +
            '"text": "Parent 4"' +
          '},' +
          '{ ' +
            '"text": "Parent 5"' +
          '}' +
        ']';


        $('#treeview6').treeview({ 
          color: "green",
          expandIcon: "glyphicon glyphicon-stop",
          collapseIcon: "glyphicon glyphicon-unchecked",
          nodeIcon: "glyphicon glyphicon-user",
          showTags: true,
          data: defaultData
        });
 
        });
</script>
{/block}
 
